<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/3/25 0025
  Time: 下午 2:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
</head>
<body bgcolor="#fff">
    <%
        //将Compute.html页面输入的要进行计算的两个变量拿过来
        String value1= request.getParameter("value1");
        String value2= request.getParameter("value2");
    %>
    <%
        if("division".equals(request.getParameter("compute"))){%>
            <!--进行除法计算，把两个参数v1和v2先传到
            divide.jsp，在那边编译运行，然后把结果拿到这边显示出来
            -->
            <jsp:include page="divide.jsp" flush="true">
            <jsp:param name="v1" value="<%=value1%>"/>
            <jsp:param name="v2" value="<%=value2%>"/>
            </jsp:include>
        <%}else if("addition".equals(request.getParameter("compute"))){%>
            <!--进行加法计算，把两个参数v1和v2先传到
           addition.jsp，在那边编译运行，然后把结果拿到这边显示出来
           -->
            <jsp:include page="addition.jsp" flush="true">
                <jsp:param name="v1" value="<%=value1%>"/>
                <jsp:param name="v2" value="<%=value2%>"/>
            </jsp:include>
        <%}else if("subtraction".equals(request.getParameter("compute"))){%>
            <!--减法运算 subtraction.jsp拿过来，跟本页面一起编
           译执行-->
            <%@include file="subtraction.jsp"%>
        <%}else{%>
            <!--乘法运算 直接把multiply.jsp拿过来，跟本页面一起编
            译执行-->
            <%@include file="multiply.jsp"%>
        <%}%>
</body>
</html>
